
/**
 * 根据value获取对应的name值
 * @param {Array} array [对应得数据字典列表]
 * @param {String} code  [对应得value]
 */
export function convertConstName (array, code, nameKey = 'name', valueKey = 'value') {
  for (const type of array) {
    if (type[valueKey] === code + '') {
      return type[nameKey] || '无'
    }
  }
  return code || '无'
}
